<?php
/* ========================================
 * --------------------
 *  AdminPage.php
 * --------------------
 * Created on 30.03.2010
 * ========================================
 * $Revision: $
 * $Author: Dmitry Boycov
 * $HeadURL: $ 
 * $Id: $
 * ========================================
 * Changes ["date: description (who)"]:
 *
 * 30.03.2010: Original version (WHo)
 * 16:27:12: Time 
 */

require_once("app/Page.php");

class AdminPage extends Page{

	public function __construct(){
		$this->content = '<div id="create-new-user-form-id">
				<div>Name: <input type="text" id="new-user-name"/></div>
				<div>Login: <input type="pasword" id="login-user-name"/></div>
				<input type="button" id="btn-create-new-user" value="create">
			</div>
			<script type="text/javascript">
			$("#btn-create-new-user").click(function(){
		    	GALLERY.mask();
				$.ajax({
					url: "'.$this->tabKey.'",
					data:({
						action:"createnewuser",
						name:$("#new-user-name").val(),
						login:$("#login-user-name").val()
					}),
					success: function(data){
						$("#create-new-user-form-id").append(data);
						GALLERY.unmask();
					},
					error: function(data){
						alert("Ajax-request error.");
						GALLERY.unmask();
					}
				});
			});
			</script>';
	}

	public function show(){
		$html = $this->createHeader();
		$html.= $this->generateDocumentReady();
		$html.= $this->content;
		$html.= $this->createFooter();
		echo $html;
	}

}
?>